package com.ktwlsoft.archivemanage.domain.business.repositoryService.customAnalysis;

import java.util.List;

import org.springframework.stereotype.Service;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.ktwlsoft.archivemanage.domain.dao.repository.customAnalysis.IAnalysisIndexMapper;
import com.ktwlsoft.archivemanage.domain.dao.entity.customAnalysis.AnalysisIndex;

/**
 * analysis_index--指标业务层接口实现类
 *
 * @author zhuhe on 2019-11-27 15:32:02
 * @version 1.0
 */
@Service("IAnalysisIndexService")
public class AnalysisIndexRepositoryService {
	
	private final IAnalysisIndexMapper analysisIndexMapper;

	public AnalysisIndexRepositoryService(IAnalysisIndexMapper analysisIndexMapper) {
		this.analysisIndexMapper = analysisIndexMapper;
	}

	/**
 	 * 查询分页 on 2019-11-27 15:32:02
 	 * @param pn 第几页
     * @param pageSize 每页多少条
 	 * @param analysisIndex analysisIndex
 	 * @return PageInfo<AnalysisIndex>
 	 */
	public PageInfo<AnalysisIndex> findPage(int pn,int pageSize,AnalysisIndex analysisIndex) {
		PageHelper.startPage(pn,pageSize);
		PageInfo<AnalysisIndex> pageInfo = new PageInfo<AnalysisIndex>(analysisIndexMapper.findList(analysisIndex));
		return pageInfo;
	}

    /**
	 * 查询集合 on 2019-11-27 15:32:02
	 * @param analysisIndex analysisIndex
	 * @return List<AnalysisIndex>
	 */
	public List<AnalysisIndex> findList(AnalysisIndex analysisIndex) {
		return analysisIndexMapper.findList(analysisIndex);
	}

    /**
	 * 根据ID查询信息 on 2019-11-27 15:32:02
	 * @param id	主键
	 * @return AnalysisIndex
	 */
	public AnalysisIndex getById(Long id){
		return analysisIndexMapper.getById(id);
	}

	/**
	 * 根据分析ID查询信息 on 2019-11-27 15:32:02
	 * @param analysisId analysisId
	 * @return AnalysisIndex
	 */
	public List<AnalysisIndex> getByAnalysisId(Long analysisId){
		return analysisIndexMapper.getByAnalysisId(analysisId);
	}

   /**
	 * 新增 on 2019-11-27 15:32:02
	 * @param analysisIndex analysisIndex
	 * @return int
	 */
	public int insert(AnalysisIndex analysisIndex){
		return analysisIndexMapper.insert(analysisIndex);
	}

	/**
	  * 批量新增 on 2019/11/27 17:43
	  *
	  * @param list list
	  * @return int
	  */
	public int manyInsert(List<AnalysisIndex> list){
		return analysisIndexMapper.manyInsert(list);
	}

   /**
	 * 修改 on 2019-11-27 15:32:02
	 * @param analysisIndex analysisIndex
	 * @return int
	 */
	public int update(AnalysisIndex analysisIndex){
		return analysisIndexMapper.update(analysisIndex);
	}

   /**
	 * 根据id集合批量删除信息 on 2019-11-27 15:32:02
	 * @param analysisIndexArr	主键编号集合
	 * @return int
	 */
	public int deleteByIds(List<Long> analysisIndexArr){
		return analysisIndexMapper.deleteByIds(analysisIndexArr);
	}

   /**
	 * 根据id删除信息 on 2019-11-27 15:32:02
	 * @param id id
	 * @return int
	 */
	public int deleteById(Long id){
		return analysisIndexMapper.deleteById(id);
	}

	/**
	 * 根据自助分析id删除信息 on 2019-11-27 15:32:02
	 * @param analysisId analysisId
	 * @return int
	 */
	public int deleteByAnalysisId(Long analysisId){
		return analysisIndexMapper.deleteByAnalysisId(analysisId);
	}
}
